Skip to content

fix: Align transformed mesh areas with their cell edges - #608

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/mesh-geometry-transformed-areas
Oct 2, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/mesh-geometry-transformed-areas

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Compute rectangular transformed cell areas from the geometry's published transformed edges. Adapt-image weights now use the same slim-grid coordinates for both diagnostics, avoiding the oversampled-grid IndexError and matching the mapper's node-midpoint convention.

Part of #605. The baseline fails on a real 25-pixel adapt-image mapper with sub-size 2 (IndexError: index 83 ... size 25). The companion workspace regression verifies NumPy and eager/compiled JAX geometry.

API Changes

areas_transformed and areas_for_magnification now match the outer product of transformed edge spacings. Clamped guard cells can have zero area; live-cell positivity and total area are tested. edges_transformed retains its existing raw NumPy/JAX array contract. See full details below.

Test Plan

  • Full PyAutoArray: 1,919 passed, 0 failed, exit 0.
  • Focused geometry/interpolator: 34 passed.
  • Workspace smoke: new geometry and existing rectangular likelihood, 2 passed.
  • Original indexing failure reproduced; guard-cell expectations updated to explicit edge geometry after the initial suite exposed stale positivity assumptions.
  • Heart YELLOW acknowledged: “manifest drift: workspace checkouts (manifest ↔ disk) — 1 mismatch(es) vs PyAutoMind/repos.yaml”. Stale: “release validation incomplete: no rehearsal for current source”. No release or merge.
Full API Changes (for automation & release notes)

Changed Behaviour

  • MeshGeometryRectangular.areas_transformed: derive per-cell areas from node-midpoint edges, avoiding mismatch between oversampled coordinates and slim adapt weights.
  • MeshGeometryRectangular.areas_for_magnification: inherits those corrected areas.
  • Clamped guard cells may have zero area; the domain's total area remains unchanged.

Unchanged

  • The standalone adaptive_rectangular_areas_from helper is untouched.
  • No signature or return-wrapper changes.

Generated by the PyAutoLabs agent workflow.

@Jammy2211

Copy link
Copy Markdown
Collaborator Author

Workspace regression PR: PyAutoLabs/autolens_workspace_test#339. Merge/release the library before merging the dependent workspace regression.

@Jammy2211
Jammy2211 merged commit 0126bce into main Oct 2, 2026
3 checks passed
@Jammy2211
Jammy2211 deleted the feature/mesh-geometry-transformed-areas branch October 2, 2026 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending-release PR queued for the next release build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant